<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>分布式系统：现代软件的"甜蜜烦恼" | 技术小馆</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .code-block {
            background: #2d2d2d;
            border-left: 4px solid #667eea;
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .highlight {
            position: relative;
        }
        .highlight::after {
            content: '';
            position: absolute;
            left: 0;
            bottom: 0;
            width: 100%;
            height: 30%;
            background-color: rgba(102, 126, 234, 0.2);
            z-index: -1;
            transition: all 0.3s ease;
        }
        .highlight:hover::after {
            height: 50%;
        }
        .fade-in {
            animation: fadeIn 0.5s ease-in-out;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-4 leading-tight">
                        <span class="highlight">分布式系统</span><br>
                        现代软件的"甜蜜烦恼"
                    </h1>
                    <p class="text-xl opacity-90 mb-8">用Deepseek解决分布式系统的日常挑战，打造高性能、高可用的系统架构</p>
                    <div class="flex space-x-4">
                        <a href="#problem" class="bg-white text-indigo-700 hover:bg-gray-100 px-6 py-3 rounded-lg font-medium transition duration-300 flex items-center">
                            <i class="fas fa-bug mr-2"></i> 问题诊断
                        </a>
                        <a href="#solution" class="bg-indigo-800 hover:bg-indigo-900 text-white px-6 py-3 rounded-lg font-medium transition duration-300 flex items-center">
                            <i class="fas fa-lightbulb mr-2"></i> 解决方案
                        </a>
                    </div>
                </div>
                <div class="md:w-1/2">
                    <img src="https://cdn.nlark.com/yuque/0/2025/png/21449790/1739783654318-e40c5334-d4f2-4717-8759-0fa5e88a87c1.png" alt="分布式系统示意图" class="rounded-xl shadow-2xl border-4 border-white">
                </div>
            </div>
        </div>
    </section>

    <!-- Problem Section -->
    <section id="problem" class="py-16 bg-white">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">分布式系统的日常挑战</h2>
                <div class="w-20 h-1 bg-indigo-600 mx-auto"></div>
                <p class="text-gray-600 max-w-2xl mx-auto mt-4">想象一下这样的场景：你开了一家Java程序员奶茶店，刚开始只有1个柜台（单体应用），顾客排队井然有序。后来生意火爆，你开了10个分店（微服务），却发现：</p>
            </div>

            <div class="grid md:grid-cols-3 gap-8">
                <div class="bg-gray-50 p-6 rounded-xl card-hover fade-in" style="animation-delay: 0.1s;">
                    <div class="text-indigo-600 text-3xl mb-4">
                        <i class="fas fa-map-marked-alt"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">服务发现</h3>
                    <p class="text-gray-600">顾客不知道去哪家分店（服务发现）</p>
                </div>
                <div class="bg-gray-50 p-6 rounded-xl card-hover fade-in" style="animation-delay: 0.2s;">
                    <div class="text-indigo-600 text-3xl mb-4">
                        <i class="fas fa-balance-scale-right"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">负载均衡</h3>
                    <p class="text-gray-600">有的分店排长队，有的门可罗雀（负载均衡）</p>
                </div>
                <div class="bg-gray-50 p-6 rounded-xl card-hover fade-in" style="animation-delay: 0.3s;">
                    <div class="text-indigo-600 text-3xl mb-4">
                        <i class="fas fa-database"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">数据一致性</h3>
                    <p class="text-gray-600">总店和分店的库存对不上账（数据一致性）</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Case Study -->
    <section class="py-16 bg-gray-50">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0 md:pr-8">
                    <h2 class="text-3xl font-bold mb-6">实战案例：电商秒杀系统崩溃事件</h2>
                    <h3 class="text-xl font-semibold mb-4 text-indigo-600">项目背景</h3>
                    <p class="mb-6 text-gray-700">我们团队开发了一个电商平台，近期要上线"618手机秒杀"活动。压力测试时发现：</p>
                    <ul class="space-y-3 mb-8">
                        <li class="flex items-start">
                            <span class="text-red-500 mr-2"><i class="fas fa-exclamation-circle"></i></span>
                            <span><strong>库存超卖</strong>：100台手机卖出了120台</span>
                        </li>
                        <li class="flex items-start">
                            <span class="text-red-500 mr-2"><i class="fas fa-exclamation-circle"></i></span>
                            <span><strong>服务雪崩</strong>：一个服务崩溃导致整个系统瘫痪</span>
                        </li>
                        <li class="flex items-start">
                            <span class="text-red-500 mr-2"><i class="fas fa-exclamation-circle"></i></span>
                            <span><strong>响应延迟</strong>：高峰期下单需要等待15秒</span>
                        </li>
                    </ul>
                </div>
                <div class="md:w-1/2">
                    <img src="https://cdn.nlark.com/yuque/0/2025/png/21449790/1739783830404-2fee7e91-8473-41c2-932a-4105a14b2a5a.png" alt="电商秒杀问题" class="rounded-xl border border-gray-200 shadow-md">
                </div>
            </div>

            <div class="mt-12">
                <h3 class="text-xl font-semibold mb-4 text-indigo-600">问题代码示例</h3>
                <p class="mb-4 text-gray-700">这是原来的库存服务代码：</p>
                <div class="code-block text-gray-200 p-4 rounded-lg overflow-x-auto mb-8">
                    <pre><code class="language-java">// 问题1：简单的库存扣减
public class InventoryService {
    private int stock = 100; // 初始库存
    
    public boolean deductStock() {
        if(stock > 0) {
            stock--;  // 致命漏洞：并发场景下会超卖
            return true;
        }
        return false;
    }
}

// 问题2：粗暴的服务调用
public class OrderService {
    public void createOrder() {
        InventoryService inventory = new InventoryService(); // 直连服务
        if(inventory.deductStock()) {
            // 创建订单
        }
    }
}</code></pre>
                </div>
            </div>
        </div>
    </section>

    <!-- Diagnosis -->
    <section id="diagnosis" class="py-16 bg-white">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="text-center mb-12">
                <h2 class="text-3xl font-bold mb-4">Deepseek诊断报告：揪出三大"罪魁祸首"</h2>
                <div class="w-20 h-1 bg-indigo-600 mx-auto"></div>
                <p class="text-gray-600 max-w-2xl mx-auto mt-4">当我们把代码提交给Deepseek后，它给出了这样的分析结果：</p>
            </div>

            <div class="overflow-x-auto">
                <table class="min-w-full bg-white rounded-lg overflow-hidden">
                    <thead class="bg-indigo-600 text-white">
                        <tr>
                            <th class="py-3 px-4 text-left">问题类型</th>
                            <th class="py-3 px-4 text-left">具体描述</th>
                            <th class="py-3 px-4 text-left">危险级别</th>
                        </tr>
                    </thead>
                    <tbody class="divide-y divide-gray-200">
                        <tr>
                            <td class="py-4 px-4 font-medium">并发安全</td>
                            <td class="py-4 px-4">库存操作无锁保护</td>
                            <td class="py-4 px-4 text-red-500 font-bold">🔴 致命</td>
                        </tr>
                        <tr class="bg-gray-50">
                            <td class="py-4 px-4 font-medium">服务耦合</td>
                            <td class="py-4 px-4">直连服务调用导致雪崩风险</td>
                            <td class="py-4 px-4 text-orange-500 font-bold">🟠 高危</td>
                        </tr>
                        <tr>
                            <td class="py-4 px-4 font-medium">性能瓶颈</td>
                            <td class="py-4 px-4">单节点库存服务吞吐量不足</td>
                            <td class="py-4 px-4 text-yellow-500 font-bold">🟡 警告</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </section>

    <!-- Solution -->
    <section id="solution" class="py-16 bg-gray-50">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="text-center mb-12">
                <h2 class="text-3xl font-bold mb-4">Deepseek解决方案：三步打造稳健系统</h2>
                <div class="w-20 h-1 bg-indigo-600 mx-auto"></div>
            </div>

            <div class="grid md:grid-cols-3 gap-8 mb-16">
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 text-indigo-600 rounded-full w-10 h-10 flex items-center justify-center mr-4">
                            <span class="font-bold">1</span>
                        </div>
                        <h3 class="text-xl font-semibold">解决库存超卖</h3>
                    </div>
                    <p class="text-gray-600 mb-4"><strong>Deepseek建议：</strong></p>
                    <ul class="list-disc pl-5 space-y-2 text-gray-700 mb-4">
                        <li>使用分布式锁（Redis实现）</li>
                        <li>采用CAS（Compare And Swap）机制</li>
                    </ul>
                    <div class="code-block text-gray-200 p-4 rounded-lg overflow-x-auto text-sm">
                        <pre><code class="language-java">public class InventoryService {
    private final RedisLock lock = new RedisLock("stock_lock");
    private int stock = 100;

    public boolean deductStock() {
        return lock.executeWithLock(() -> { // 自动加锁/释放
            if(stock > 0) {
                stock--;
                return true;
            }
            return false;
        });
    }
}</code></pre>
                    </div>
                </div>

                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 text-indigo-600 rounded-full w-10 h-10 flex items-center justify-center mr-4">
                            <span class="font-bold">2</span>
                        </div>
                        <h3 class="text-xl font-semibold">防止服务雪崩</h3>
                    </div>
                    <p class="text-gray-600 mb-4"><strong>Deepseek建议：</strong></p>
                    <ul class="list-disc pl-5 space-y-2 text-gray-700 mb-4">
                        <li>引入服务注册中心（Nacos）</li>
                        <li>添加熔断机制（Sentinel）</li>
                    </ul>
                    <div class="code-block text-gray-200 p-4 rounded-lg overflow-x-auto text-sm">
                        <pre><code class="language-java">@FeignClient(name = "inventory-service", 
             fallback = InventoryFallback.class)
public interface InventoryClient {
    @PostMapping("/deduct")
    boolean deductStock();
}

public class OrderService {
    @Autowired
    private InventoryClient inventoryClient;

    public void createOrder() {
        if(inventoryClient.deductStock()) {
            // 创建订单
        }
    }
}</code></pre>
                    </div>
                </div>

                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 text-indigo-600 rounded-full w-10 h-10 flex items-center justify-center mr-4">
                            <span class="font-bold">3</span>
                        </div>
                        <h3 class="text-xl font-semibold">提升系统性能</h3>
                    </div>
                    <p class="text-gray-600 mb-4"><strong>Deepseek建议：</strong></p>
                    <ul class="list-disc pl-5 space-y-2 text-gray-700 mb-4">
                        <li>库存服务分片部署</li>
                        <li>添加本地缓存</li>
                    </ul>
                    <div class="code-block text-gray-200 p-4 rounded-lg overflow-x-auto text-sm">
                        <pre><code class="language-yaml"># application.yml
deepseek:
  sharding:
    inventory: 
      nodes: 3 # 分3个节点
      algorithm: hash # 哈希分片</code></pre>
                    </div>
                </div>
            </div>

            <div>
                <h3 class="text-2xl font-bold mb-6 text-center">效果对比：改造前后的惊人变化</h3>
                <p class="text-center mb-8 text-gray-600">我们用JMeter模拟1万用户同时抢购，结果对比：</p>
                
                <div class="overflow-x-auto">
                    <table class="min-w-full bg-white rounded-lg overflow-hidden shadow-md">
                        <thead class="bg-indigo-600 text-white">
                            <tr>
                                <th class="py-3 px-4 text-left">指标</th>
                                <th class="py-3 px-4 text-left">改造前</th>
                                <th class="py-3 px-4 text-left">改造后</th>
                                <th class="py-3 px-4 text-left">提升</th>
                            </tr>
                        </thead>
                        <tbody class="divide-y divide-gray-200">
                            <tr>
                                <td class="py-4 px-4 font-medium">超卖次数</td>
                                <td class="py-4 px-4">237次</td>
                                <td class="py-4 px-4">0次</td>
                                <td class="py-4 px-4 text-green-600 font-bold">100%</td>
                            </tr>
                            <tr class="bg-gray-50">
                                <td class="py-4 px-4 font-medium">平均响应时间</td>
                                <td class="py-4 px-4">15.2s</td>
                                <td class="py-4 px-4">0.8s</td>
                                <td class="py-4 px-4 text-green-600 font-bold">94.7%</td>
                            </tr>
                            <tr>
                                <td class="py-4 px-4 font-medium">系统吞吐量</td>
                                <td class="py-4 px-4">120 req/s</td>
                                <td class="py-4 px-4">5200 req/s</td>
                                <td class="py-4 px-4 text-green-600 font-bold">4233%</td>
                            </tr>
                            <tr class="bg-gray-50">
                                <td class="py-4 px-4 font-medium">服务可用率</td>
                                <td class="py-4 px-4">65%</td>
                                <td class="py-4 px-4">99.98%</td>
                                <td class="py-4 px-4 text-green-600 font-bold">35%</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </section>

    <!-- Principles -->
    <section class="py-16 bg-white">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="text-center mb-12">
                <h2 class="text-3xl font-bold mb-4">Deepseek实现原理揭秘</h2>
                <div class="w-20 h-1 bg-indigo-600 mx-auto"></div>
                <p class="text-gray-600 max-w-2xl mx-auto mt-4">Deepseek解决分布式问题的秘密武器：</p>
            </div>

            <div class="grid md:grid-cols-3 gap-8 mb-12">
                <div class="bg-gray-50 p-6 rounded-xl">
                    <div class="text-indigo-600 text-4xl mb-4 flex items-center">
                        <i class="fas fa-user-tie mr-3"></i>
                        <h3 class="text-xl font-semibold">服务发现</h3>
                    </div>
                    <p class="text-gray-700 mb-4">就像餐厅的领位员知道所有空桌的位置，Deepseek通过注册中心：</p>
                    <ul class="list-disc pl-5 space-y-2 text-gray-700">
                        <li>实时记录所有服务的"坐标"（IP+端口）</li>
                        <li>自动剔除故障服务（心跳检测）</li>
                    </ul>
                </div>

                <div class="bg-gray-50 p-6 rounded-xl">
                    <div class="text-indigo-600 text-4xl mb-4 flex items-center">
                        <i class="fas fa-random mr-3"></i>
                        <h3 class="text-xl font-semibold">负载均衡</h3>
                    </div>
                    <p class="text-gray-700 mb-4">Deepseek内置多种分配策略：</p>
                    <ul class="list-disc pl-5 space-y-2 text-gray-700">
                        <li><strong>轮询模式</strong>：像食堂阿姨挨个窗口分菜</li>
                        <li><strong>加权模式</strong>：给性能好的服务器更多任务</li>
                        <li><strong>一致性哈希</strong>：让特定请求永远找同一个服务</li>
                    </ul>
                </div>

                <div class="bg-gray-50 p-6 rounded-xl">
                    <div class="text-indigo-600 text-4xl mb-4 flex items-center">
                        <i class="fas fa-bolt mr-3"></i>
                        <h3 class="text-xl font-semibold">熔断降级</h3>
                    </div>
                    <p class="text-gray-700 mb-4">当某个服务连续失败时，Deepseek会：</p>
                    <ul class="list-disc pl-5 space-y-2 text-gray-700">
                        <li>打开"保险丝"（停止调用问题服务）</li>
                        <li>执行降级逻辑（返回默认值）</li>
                        <li>定时检测服务恢复情况</li>
                    </ul>
                </div>
            </div>

            <div class="bg-indigo-50 border-l-4 border-indigo-600 p-6 rounded-r-lg">
                <h3 class="text-xl font-semibold text-indigo-700 mb-4 flex items-center">
                    <i class="fas fa-project-diagram mr-2"></i> Deepseek架构图
                </h3>
                <div class="mermaid">
                    graph TD
                        A[客户端] --> B[API网关]
                        B --> C[服务注册中心]
                        B --> D[服务A]
                        B --> E[服务B]
                        B --> F[服务C]
                        C --> D
                        C --> E
                        C --> F
                        D --> G[数据库集群]
                        E --> G
                        F --> G
                        style A fill:#f0f9ff,stroke:#0369a1
                        style B fill:#e0f2fe,stroke:#0ea5e9
                        style C fill:#bae6fd,stroke:#38bdf8
                        style D fill:#fef2f2,stroke:#f87171
                        style E fill:#ecfdf5,stroke:#34d399
                        style F fill:#eff6ff,stroke:#60a5fa
                        style G fill:#f5f3ff,stroke:#8b5cf6
                </div>
            </div>
        </div>
    </section>

    <!-- FAQ -->
    <section class="py-16 bg-gray-50">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="text-center mb-12">
                <h2 class="text-3xl font-bold mb-4">常见问题解决方案库</h2>
                <div class="w-20 h-1 bg-indigo-600 mx-auto"></div>
            </div>

            <div class="accordion space-y-4">
                <div class="bg-white rounded-lg shadow-md overflow-hidden">
                    <button class="accordion-btn w-full flex justify-between items-center p-6 text-left">
                        <h3 class="text-lg font-semibold">1. 数据不一致怎么办？</h3>
                        <i class="fas fa-chevron-down transition-transform duration-300"></i>
                    </button>
                    <div class="accordion-content px-6 pb-6 hidden">
                        <p class="text-gray-600 mb-4"><strong>场景：</strong>订单已支付，库存未扣减</p>
                        <p class="text-gray-600 mb-4"><strong>Deepseek方案：</strong></p>
                        <div class="code-block text-gray-200 p-4 rounded-lg overflow-x-auto">
                            <pre><code class="language-java">@DeepSeekTransaction
public void createOrder() {
    paymentService.pay();     // 支付
    inventoryService.deduct(); // 扣库存
} // 自动开启分布式事务</code></pre>
                        </div>
                    </div>
                </div>

                <div class="bg-white rounded-lg shadow-md overflow-hidden">
                    <button class="accordion-btn w-full flex justify-between items-center p-6 text-left">
                        <h3 class="text-lg font-semibold">2. 日志排查困难？</h3>
                        <i class="fas fa-chevron-down transition-transform duration-300"></i>
                    </button>
                    <div class="accordion-content px-6 pb-6 hidden">
                        <p class="text-gray-600 mb-4"><strong>Deepseek妙招：</strong>自动注入TraceID</p>
                        <div class="code-block text-gray-200 p-4 rounded-lg overflow-x-auto">
                            <pre><code class="language-java">2023-06-18 14:20:35 [TraceID:abc123] 用户下单
2023-06-18 14:20:35 [TraceID:abc123] 库存扣减</code></pre>
                        </div>
                    </div>
                </div>

                <div class="bg-white rounded-lg shadow-md overflow-hidden">
                    <button class="accordion-btn w-full flex justify-between items-center p-6 text-left">
                        <h3 class="text-lg font-semibold">3. 配置管理混乱？</h3>
                        <i class="fas fa-chevron-down transition-transform duration-300"></i>
                    </button>
                    <div class="accordion-content px-6 pb-6 hidden">
                        <p class="text-gray-600 mb-4"><strong>统一配置中心：</strong></p>
                        <div class="code-block text-gray-200 p-4 rounded-lg overflow-x-auto">
                            <pre><code class="language-java">@Value("${discount.rate}") // 从配置中心获取
private double discountRate;</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Best Practices -->
    <section class="py-16 bg-white">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="text-center mb-12">
                <h2 class="text-3xl font-bold mb-4">最佳实践：Deepseek配置指南</h2>
                <div class="w-20 h-1 bg-indigo-600 mx-auto"></div>
            </div>

            <div class="grid md:grid-cols-2 gap-8">
                <div>
                    <h3 class="text-xl font-semibold mb-4 text-indigo-600">1. 限流配置（防止流量洪峰）</h3>
                    <div class="code-block text-gray-200 p-4 rounded-lg overflow-x-auto">
                        <pre><code class="language-yaml">deepseek:
  flow-control:
    order-service: 
      qps: 1000 # 每秒最多1000请求
      block-strategy: fast-fail # 快速失败</code></pre>
                    </div>
                </div>

                <div>
                    <h3 class="text-xl font-semibold mb-4 text-indigo-600">2. 熔断配置（服务保护）</h3>
                    <div class="code-block text-gray-200 p-4 rounded-lg overflow-x-auto">
                        <pre><code class="language-yaml">deepseek:
  circuit-breaker:
    payment-service:
      failure-threshold: 50% # 失败率超50%熔断
      reset-timeout: 30s    # 30秒后尝试恢复</code></pre>
                    </div>
                </div>

                <div>
                    <h3 class="text-xl font-semibold mb-4 text-indigo-600">3. 线程池优化</h3>
                    <div class="code-block text-gray-200 p-4 rounded-lg overflow-x-auto">
                        <pre><code class="language-java">@DeepseekThreadPool(name = "orderPool", 
                   coreSize = 20, 
                   maxSize = 100)
public void processOrder() {
    // 订单处理逻辑
}</code></pre>
                    </div>
                </div>

                <div>
                    <h3 class="text-xl font-semibold mb-4 text-indigo-600">4. 超时设置规范</h3>
                    <div class="code-block text-gray-200 p-4 rounded-lg overflow-x-auto">
                        <pre><code class="language-yaml">deepseek:
  timeout:
    payment-service: 5s # 支付服务
    sms-service: 1s     # 短信服务
    search-service: 2s  # 搜索服务
    recommend-service: 3s # 推荐服务</code></pre>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Pitfalls -->
    <section class="py-16 bg-gray-50">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="text-center mb-12">
                <h2 class="text-3xl font-bold mb-4">避坑指南：新手常见错误</h2>
                <div class="w-20 h-1 bg-indigo-600 mx-auto"></div>
            </div>

            <div class="grid md:grid-cols-3 gap-8">
                <div class="bg-white p-6 rounded-xl shadow-sm border border-gray-200">
                    <div class="text-red-500 text-2xl mb-3">
                        <i class="fas fa-exclamation-triangle"></i>
                    </div>
                    <h3 class="text-lg font-semibold mb-3">过度设计陷阱</h3>
                    <p class="text-gray-600 mb-3"><strong>错误做法：</strong>3个节点的系统强行上Kubernetes</p>
                    <p class="text-gray-600"><strong>Deepseek建议：</strong>根据QPS智能推荐架构复杂度</p>
                </div>

                <div class="bg-white p-6 rounded-xl shadow-sm border border-gray-200">
                    <div class="text-red-500 text-2xl mb-3">
                        <i class="fas fa-clock"></i>
                    </div>
                    <h3 class="text-lg font-semibold mb-3">超时设置不当</h3>
                    <p class="text-gray-600 mb-3"><strong>反面教材：</strong>所有服务都设置3秒超时</p>
                    <p class="text-gray-600"><strong>正确方案：</strong>根据服务特性差异化配置</p>
                </div>

                <div class="bg-white p-6 rounded-xl shadow-sm border border-gray-200">
                    <div class="text-red-500 text-2xl mb-3">
                        <i class="fas fa-bell-slash"></i>
                    </div>
                    <h3 class="text-lg font-semibold mb-3">忽略监控告警</h3>
                    <p class="text-gray-600 mb-3"><strong>严重后果：</strong>小问题积累成大故障</p>
                    <p class="text-gray-600"><strong>Deepseek方案：</strong>自动生成监控大盘</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Call to Action -->
    <section class="py-16 hero-gradient text-white">
        <div class="container mx-auto max-w-3xl text-center px-4">
            <h2 class="text-3xl font-bold mb-6">准备好优化你的分布式系统了吗？</h2>
            <p class="text-xl opacity-90 mb-8">Deepseek能够帮助你快速发现并解决分布式系统中的各种问题，提升系统性能和稳定性</p>
            <a href="http://www.yuque.com/jtostring" class="bg-white text-indigo-700 hover:bg-gray-100 px-8 py-4 rounded-lg font-medium transition duration-300 inline-flex items-center">
                <i class="fas fa-rocket mr-2"></i> 立即体验Deepseek
            </a>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-8">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-semibold text-white mb-2">技术小馆</h3>
                    <p class="text-gray-400">探索技术的无限可能</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-300 hover:text-white transition duration-300 flex items-center">
                        <i class="fas fa-map-marker-alt mr-2"></i> 技术小馆地址：http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
        </div>
    </footer>

    <script>
        // Initialize Mermaid
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: false,
                htmlLabels: true,
                curve: 'basis'
            }
        });

        // Accordion functionality
        document.querySelectorAll('.accordion-btn').forEach(button => {
            button.addEventListener('click', () => {
                const content = button.nextElementSibling;
                const icon = button.querySelector('i');
                
                content.classList.toggle('hidden');
                icon.classList.toggle('rotate-180');
            });
        });

        // Smooth scrolling for anchor links
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });

        // Animation on scroll
        const fadeElements = document.querySelectorAll('.fade-in');
        const observer = new IntersectionObserver((entries) => {
            entries.forEach(entry => {
                if (entry.isIntersecting) {
                    entry.target.style.opacity = 1;
                    entry.target.style.transform = 'translateY(0)';
                }
            });
        }, { threshold: 0.1 });

        fadeElements.forEach(el => {
            el.style.opacity = 0;
            el.style.transform = 'translateY(20px)';
            observer.observe(el);
        });
    </script>
</body>
</html>